<%@page import="com.yunhe.biz.SupplierBizImpl"%>
<%@page import="com.yunhe.biz.ISupplierBiz"%>
<%@page import="com.yunhe.entity.Supplier"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="nav.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商城后台管理</title>
</head>
<body>
	
	 <% 
	 	ISupplierBiz isb = new SupplierBizImpl();
	 	List<Supplier> listt = isb.getAllSupplier();
		session.setAttribute("sss", listt);
		String cname = request.getParameter("cname");
		String sname = request.getParameter("sname");
		String gname = request.getParameter("gname");
		cname = new String(cname.getBytes("ISO-8859-1"),"utf-8");
		sname = new String(sname.getBytes("ISO-8859-1"),"utf-8");
		gname = new String(gname.getBytes("ISO-8859-1"),"utf-8");
		//System.out.println(sname);
		request.setAttribute("ccname", cname);
		request.setAttribute("ssname", sname);
		request.setAttribute("ggname", gname);
	%> 
	 
	 <script type="text/javascript">
		var adddom = "<form action='../GoodsServlet?action=update&id=${param.id}' method='post' role='form'>"
				+ "<table class='table table-bordered table-hover table-condersed'>"
				+ "<tr class='active success info'>"
				+ "<td>商品名称：</td>"
				+ "<td><input type='text' name='gname' class='form-control' style='height: 30px' value='${ggname}'></td>"
				+ "</tr>"
				+ "<tr class='active success info'>"
				+ "<td>商品价格：</td>"
				+ "<td><input type='text' name='price' class='form-control' style='height: 30px' value='${param.price}'></td>"
				+ "</tr>"
				+ "<tr class='active success info'>"
				+ "<td>商品类别：</td>"
				+ "<td><select name='cid'>"
				+ "<c:forEach items='${Categorys}' var='classify'>"
				+ "<c:if test='${classify.cname.equals(ccname)}'>"
				+ "<option selected value='${classify.cid}'>${classify.cname}</option>"
				+ "</c:if>"
				+ "<option value='${classify.cid}'>${classify.cname}</option>"
				+ "</c:forEach></select></td></tr>"
				+ "<td>商品厂商：</td>"
				+ "<td><select name='sid'>"
				+ "<c:forEach items='${sss}' var='s'>"
				+ "<c:if test='${s.getSname().equals(ssname)}'>"
				+ "<option selected value='${s.sid}'>${s.getSname()}</option>"
				+ "</c:if>"
				+ "<option value='${s.sid}'>${s.getSname()}</option>"
				+ "</c:forEach></select></td></tr>"
				+ "<tr class='active success info'>" 
				+ "<tr class='active success info'>"
				+ "<td>库存数量：</td>"
				+ "<td><input type='text' name='reserve' class='form-control' style='height: 30px' value='${param.reserve}'></td>"
				+ "</tr>"
				+ "<tr class='active success info'>"
				+ "<td colspan=2><input type='submit' value='改好了，提交' class='btn'>"
				+ "</td></tr></table></form>";
		var navdom = "<strong class='am-text-danger am-text-lg'>商品信息管理</strong> / <small>GoodsInfo</small>";
		$("#abc").html(navdom);
		$("#xyz").html(adddom);
	</script> 
</body>
</html>